package com.example.xyr.myapplication.utils;

import android.app.Activity;

import com.example.xyr.myapplication.R;
import com.example.xyr.myapplication.adapter.ChatType;
import com.example.xyr.myapplication.model.BaseFriendBean;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * Created by ylcf on 2018/7/16.
 */

public class ResourceLink {

    private static int[] images = {R.drawable.image1, R.drawable.image2, R.drawable.image3,
            R.drawable.image4, R.drawable.image5, R.drawable.image6, R.drawable.image7, R.drawable.image8,
            R.drawable.image9, R.drawable.image10};

    public static String getMp4Uri(Activity activity) {
        String baseUri = "android.resource://" + activity.getPackageName() + "/";
        String[] uri = {baseUri + R.raw.windmill, baseUri + R.raw.crawl,
                baseUri + R.raw.kickball, baseUri + R.raw.master,
                baseUri + R.raw.shrimpfishing, baseUri + R.raw.slide,
                baseUri + R.raw.temptation};
        int i = new Random().nextInt(6);
        LogUtil.e("tag", "mp4第=  " + i);
        return uri[i];
    }

    public static String getError() {
        String[] errorMsg = {"输错了啊！", "你要造反啊！", "在乱输收拾你！", "再给你一次机会重新输入！"};
        int i = new Random().nextInt(3);
        return errorMsg[i];
    }

    public static int getImageUrl() {
        int i = new Random().nextInt(9);
        return images[i];
    }

    public static List<BaseFriendBean> setFriendData() {
        List<BaseFriendBean> list = new ArrayList<>();
        BaseFriendBean bean1 = new BaseFriendBean();
        bean1.setIcon(R.drawable.add_friend_icon);
        bean1.setFriendType(ChatType.TYPE_FRIEND_HEAD);
        bean1.setName("添加好友");
        BaseFriendBean bean2 = new BaseFriendBean();
        bean2.setIcon(R.drawable.group_friend_icon);
        bean2.setFriendType(ChatType.TYPE_FRIEND_HEAD);
        bean2.setName("创建群组");
        BaseFriendBean bean3 = new BaseFriendBean();
        bean3.setIcon(R.drawable.friend_msg_icon);
        bean3.setFriendType(ChatType.TYPE_FRIEND_HEAD);
        bean3.setName("好友消息");
        list.add(bean1);
        list.add(bean2);
        list.add(bean3);
        return list;
    }


}
